<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class DemoAuthor extends Model
{
    protected $table = 'demo_users';

    protected $appends = array('fullname');

    public function articles(){
        return $this->hasMany('App\Models\DemoArticle','author_id','id');
    }

    public function getFullnameAttribute($value)
    {
        return $this->firstname ." ". $this->lastname;
    }

}
